package com.lindroid.controller

import com.mit.entity.FindResult
import com.mit.entity.RespResult
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.bind.annotation.ResponseBody
import org.springframework.web.bind.annotation.RequestMethod
import javax.servlet.http.HttpServletRequest


@Controller
@RequestMapping("err")
class ErrorController {

    @RequestMapping("error")
    fun error():String{
        val a = 1/0
        return "error"
    }

    @RequestMapping("ajaxError")
    fun ajaxError(): String {
        return "thymeleaf/ajaxError"
    }

    @RequestMapping(value = ["getAjaxError"], method = [RequestMethod.POST])
    @ResponseBody
    fun getAjaxError(): FindResult {
        val a = 1 / 0
        return FindResult(data=null)
    }

}